<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page contentType="text/html;charset=UTF-8" %>
<%@ page import="com.lmpop.trade.ti_evaluate.Ti_evaluateInfo" %>
<%@ page import="com.lmpop.frame.util.PageTools" %>
<%@ page import="com.lmpop.trade.ti_personal.Ti_personalInfo" %>
<%@ page import="com.lmpop.trade.ti_attach.Ti_attachInfo" %>
<%@ page import="com.lmpop.trade.tb_ordergoods.Tb_ordergoodsInfo" %>


<%
	request.setCharacterEncoding("UTF-8");

	Map params = new Hashtable();
	
	String s_cust_id = "";	
	if( session.getAttribute("session_cust_id") != null )
	{
		 s_cust_id = session.getAttribute("session_cust_id").toString();
	}	
  
  params.put("cust_id",s_cust_id);
	
	String s_oder_no = "";
	if(request.getParameter("s_oder_no")!=null && !request.getParameter("s_oder_no").equals(""))
	{
		 s_oder_no = request.getParameter("s_oder_no");
		 params.put("e_order_no",s_oder_no);
	}

    Ti_evaluateInfo ti_evaluateInfo = new Ti_evaluateInfo();
	Tb_ordergoodsInfo  tb_ordergoodsInfo  = new Tb_ordergoodsInfo(); 
	Ti_attachInfo  ti_attachInfo = new Ti_attachInfo(); 
	Ti_personalInfo person = new Ti_personalInfo();
    
	String iStart = "0"; 
	int limit =20;
	if(request.getParameter("iStart")!=null) iStart = request.getParameter("iStart");
	
	List list = ti_evaluateInfo.getCustReplyListByPage(params,Integer.parseInt(iStart),limit);
	
	int counter = ti_evaluateInfo.getCustReplyCountByObj(params);
	
	String pageString = new PageTools().getGoogleToolsBar(counter,"index.jsp?s_oder_no="+s_oder_no+"&iStart=",Integer.parseInt(iStart),limit);
     
	 String para = "s_oder_no="+s_oder_no+"&iStart="+Integer.parseInt(iStart);
	 
    List goodslist = new LinkedList();    
 
    Hashtable detail = new Hashtable();
%>
<html>
  <head>
    
    <title>我的评价</title>
	<link href="/program/company/index/css/style.css" rel="stylesheet" type="text/css">
	<script type="text/javascript" src="/js/commen.js"></script>
</head>

<body>
	<table width="100%" cellpadding="0" cellspacing="0" border="0">
		<tr>
			<td width="90%">
				<h1>我的评价</h1>
			</td>
			<td>
		</td>
		</tr>
	</table>
	
	<form action="index.jsp" name="indexForm" method="post">
	
		  
	<table width="100%" cellpadding="0" cellspacing="0" class="dl_su">
		<tr>
			<td align="left" >
				订单编号:<input name="s_oder_no" type="text" />
				
				<!--
				
				是否回复:
			  <select name="s_info_level" id="s_info_level">
          <option value="">请选择</option> 
          <option value="0">是</option> 
					<option value="1">否</option> 
        </select> 
       -->
				<input name="searchInfo" type="submit" value="查询" onclick="document.indexForm.submit();"/>	
			</td>
		</tr>
	</table>

	<table width="100%" cellpadding="0" cellspacing="0" border="0" class="tablehe">
		<tr><td><%=pageString %></td></tr>
	</table>
	
	<% 
		int listsize = 0;
		if(list!=null && list.size()>0){
			listsize = list.size();
	%>
	
	<table width="100%" cellpadding="0" cellspacing="0" border="0" class="dl_bg">
		<tr>
			<td width="90%">
				<!--input type="button" name="delInfo" onclick="delIndexInfo()" value="删除" class="buttab"/-->
			</td>
			<td>
				总计:<%=counter %>条
			</td>
		</tr>
	</table>
	
	<table width="100%" cellpadding="1" cellspacing="1" class="listtab" border="0">
		<tr>
			<th></th>
		  <th>所购商品明细</th>
		</tr>
		
		
		<% 
			Hashtable goodsmap = new Hashtable();
			Hashtable map = new Hashtable();
			for(int i=0;i<list.size();i++){
				map = (Hashtable)list.get(i);
			 	String info_id="",order_no="",send_user_id="",content="",in_date="",infolevel="",reply_content="";;
		  	if(map.get("order_no")!=null) order_no = map.get("order_no").toString();
		  	if(map.get("send_user_id")!=null) send_user_id = map.get("send_user_id").toString();
		  	if(map.get("content")!=null) content = map.get("content").toString();
		  	if(map.get("in_date")!=null) in_date = map.get("in_date").toString();
		  	if(map.get("info_id")!=null) info_id = map.get("info_id").toString();

		  	
		  	if(in_date.length()>19){in_date =in_date.substring(0,19);}
		  	
		  	if(map.get("reply_content")!=null) reply_content = map.get("reply_content").toString();
		    
		    String reply_state="";         
        
        if(reply_content.trim().equals(""))
        {
           reply_state ="未回复";        
        }
        else
        {
           reply_state ="已回复";         
        }		  
		  
        String user_name = person.getPersonalNameByPersonalId(send_user_id);
		  
		  %>
		
		<tr>
			
		  	<td colspan=6 style="background:#EBEBEB;">
					订单编号:<%=order_no%> &nbsp;
					评论人:<%=user_name%> &nbsp;
					评论时间:<%=in_date%> &nbsp;
					是否回复:<%=reply_state%>	
					<a href="addInfo.jsp?info_id=<%=info_id%>&<%=para%>"> 
					 <img src="/program/images/icon_1.gif" border=0 />					
					 </a>					
				
				</td>
		  	
		</tr>
		
		<%  

			 detail.put("order_no",order_no);
			 detail.put("cust_id",s_cust_id);
			 goodslist = tb_ordergoodsInfo.getPersonalOrderDetail(order_no); 
			 if(goodslist!=null && goodslist.size()>0){
				for(int k=0;k<goodslist.size();k++){
						goodsmap = (Hashtable)goodslist.get(k);
						String detail_id="",goods_name="",cust_id="",state="",goods_id="";
						String file_path = "";
						if(goodsmap.get("goods_id")!=null) goods_id = goodsmap.get("goods_id").toString();
						if(goodsmap.get("goods_name")!=null) goods_name = goodsmap.get("goods_name").toString();
						if(goodsmap.get("file_path")!=null) file_path = goodsmap.get("file_path").toString();
						if(file_path.equals(""))
						{
							 file_path ="/program/member/images/cpwu.gif";
						}
		%>
		<tr>
			
		  	<td width="10%"><img src="<%=file_path%>" width="80" height="80" /></td>
		  	
		   	<td width="70%"><%=goods_name%></td>
		  		
		</tr>
		<%
					 }
				}
		%>

	  <%
			}
	  %>
		
	</table>
	
	<table width="100%" cellpadding="0" cellspacing="0" border="0" class="dl_bg">
		<tr>
			<td width="90%">
				<!--input type="button" name="delInfo" onclick="delIndexInfo()" value="删除" class="buttab"/-->
			</td>
			<td>
				总计:<%=counter %>条
			</td>
		</tr>
	</table>
	<table width="100%" cellpadding="0" cellspacing="0" border="0" class="tablehe">
		<tr><td><%=pageString %></td></tr>
	</table>
	
	<%
		 }
	%>
	  </form>
</body>

</html>
